package com.zpc.myvideoserver.service.impl;

import com.zpc.myvideoserver.common.util.RedisUtil;
import com.zpc.myvideoserver.service.VideoUrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @ClassName : VideoUrlServiceImpl  //类名
 * @Description : video url 管理实现类  //描述
 * @Author : zpc20 //作者
 * @Date: 2023/11/6  9:43
 */

@Service
public class VideoUrlServiceImpl implements VideoUrlService {
    @Autowired
    RedisUtil redisUtil;

    @Resource
    RedisTemplate<String,Object> redisTemplate;

    @Override
    public List<Object> getAllUrl(String key,Collection<Object> keys) {
        redisUtil.setBoundHashOperations(key);
        return  redisUtil.HashMultiget(keys);
    }


    @Override
    public boolean saveByHashExpire(String key, Map<String, Object> value, long time) {
        redisUtil.setBoundHashOperations(key);
        return redisUtil.hsetByExpire(value,time);
    }

    @Override
    public boolean save(Object key, Object value) {
        return false;
    }
}
